import * as THREE from "three";

const geometry = new THREE.BoxGeometry(60, 30, 10)
const material = new THREE.MeshLambertMaterial({
    color: 0xffff00,
    transparent: true,
    opacity: 0.8
})
const boxMesh = new THREE.Mesh(geometry, material)

// 三维向量 vector3
const v3 = new THREE.Vector3(50, 50, 50)
// // set方法
// v3.set(100, 100, 100)
// v3.x = 150
// boxMesh.position.set(20, 0, 0)
// boxMesh.position.x = -20
// boxMesh.scale.x = 2
// boxMesh.scale.set(1.5, 1, 0.5)
// boxMesh.translateX(20) //本质上就是改变position的X分量
// console.log(boxMesh.position.x,"position的X值");
// 按照某一个向量方向平移
v3.normalize()//转化为单位向量
boxMesh.translateOnAxis(v3,40)

export default boxMesh